//
//  YSAVPlayerHelper.m
//  YSPlayer_iOS
//
//  Created by 宋宏康 on 2020/2/12.
//

#import "YsCloudFileManageSDKHelper.h"
NSString *const kResourcesBundleName = @"YsCloudFileManageSDK";

@implementation YsCloudFileManageSDKHelper


+ (UIImage *)imageWithName:(NSString *)name {
    static NSBundle *resourceBundle = nil;
    if (!resourceBundle) {
        NSBundle *mainBundle = [NSBundle bundleForClass:self];
        NSString *resourcePath = [mainBundle pathForResource:kResourcesBundleName ofType:@"bundle"];
        resourceBundle = [NSBundle bundleWithPath:resourcePath] ?: mainBundle;
    }
    UIImage *image = [UIImage imageNamed:name inBundle:resourceBundle compatibleWithTraitCollection:nil];
    return image;
}


+ (NSBundle *)getCurentBundle
{
    static NSBundle *resourceBundle = nil;
    NSBundle *mainBundle = [NSBundle bundleForClass:self];
    NSString *resourcePath = [mainBundle pathForResource:kResourcesBundleName ofType:@"bundle"];
    resourceBundle = [NSBundle bundleWithPath:resourcePath] ?: mainBundle;
    return resourceBundle;
}
@end
